package com.ruoyi.system.service.impl;

import java.util.List;

import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.GenVendInfoPOMapper;
import com.ruoyi.system.domain.GenVendInfoPO;
import com.ruoyi.system.service.IGenVendInfoPOService;

/**
 * 供应商主数据Service业务层处理
 * 
 * @author dongbing
 * @date 2025-05-05
 */
@Service
public class GenVendInfoPOServiceImpl implements IGenVendInfoPOService 
{
    @Autowired
    private GenVendInfoPOMapper genVendInfoPOMapper;

    /**
     * 查询供应商主数据
     * 
     * @param id 供应商主数据主键
     * @return 供应商主数据
     */
    @Override
    public GenVendInfoPO selectGenVendInfoPOById(Long id)
    {
        return genVendInfoPOMapper.selectGenVendInfoPOById(id);
    }

    /**
     * 查询供应商主数据列表
     * 
     * @param genVendInfoPO 供应商主数据
     * @return 供应商主数据
     */
    @Override
    public List<GenVendInfoPO> selectGenVendInfoPOList(GenVendInfoPO genVendInfoPO)
    {
        return genVendInfoPOMapper.selectGenVendInfoPOList(genVendInfoPO);
    }

    @Override
    public void vendJoinBefore(GenVendInfoPO genVendInfoPO) {
        // 设置供应商信息
        genVendInfoPO.setVendCode(IdUtils.simpleUUID());
    }

    /**
     * 新增供应商主数据
     * 
     * @param genVendInfoPO 供应商主数据
     * @return 结果
     */
    @Override
    public int insertGenVendInfoPO(GenVendInfoPO genVendInfoPO)
    {
        return genVendInfoPOMapper.insertGenVendInfoPO(genVendInfoPO);
    }

    /**
     * 修改供应商主数据
     * 
     * @param genVendInfoPO 供应商主数据
     * @return 结果
     */
    @Override
    public int updateGenVendInfoPO(GenVendInfoPO genVendInfoPO)
    {
        return genVendInfoPOMapper.updateGenVendInfoPO(genVendInfoPO);
    }

    /**
     * 批量删除供应商主数据
     * 
     * @param ids 需要删除的供应商主数据主键
     * @return 结果
     */
    @Override
    public int deleteGenVendInfoPOByIds(Long[] ids)
    {
        return genVendInfoPOMapper.deleteGenVendInfoPOByIds(ids);
    }

    /**
     * 删除供应商主数据信息
     * 
     * @param id 供应商主数据主键
     * @return 结果
     */
    @Override
    public int deleteGenVendInfoPOById(Long id)
    {
        return genVendInfoPOMapper.deleteGenVendInfoPOById(id);
    }
}
